package forTest;

import java.util.*;

/**
 * Created by wangyg on 2017/9/19.
 */
public class Main {

    public static void main(String[] args) {
        Boolean ifRight=false;
        Map<String,String> map=new HashMap<String,String>();
        map.put("1","1");
        Map<String,String> map2=new HashMap<String,String>();
        map2.put("1","2");



        List<Map<String,String>> list=new ArrayList<Map<String,String>>();
        list.add(map);
        list.add(map2);


        for (Map<String, String> mapStr : list) {
            String s = mapStr.get("1");
            if(s.equals("1")){
                ifRight=true;
                if(ifRight){
                    Set<Map.Entry<String, String>> entries = mapStr.entrySet();
                    for (Map.Entry<String, String> entry : entries) {
                        System.out.println(entry.getKey()+":"+entry.getValue());
                    }
                }
            }
        }
    }
}
